<include file="Public/sui_header" />
<volist name="list" id="vo">
    <div class="card">
        <div class="card-header">
            <span class="icon icon-friends"></span> {$vo['funding']['name']}
        </div>
        <div class="card-content">
            <div class="card-content-inner" onclick="window.location.href='{:U(\'Funding/detail\', [\'id\'=>$vo[\'funding\'][\'id\']])}'">
                <div class="row">
                    <div class="col-20" style="width:30%">
                        <img class="list-img" src="__PUBLIC__/file/{$vo['funding']['img']}" />
                    </div>
                    <div class="col-50" style="width:60%">
                        <!-- 众筹类型：{$vo['fundingType']['long_name']} <br/> -->
                        价格：￥{$vo['funding']['funding_price']} * {:count(explode(',', $vo['tourist_ids']))}  <br/>
                        保险金额：￥{$vo['insurance_price']}<br/>
                        人数：{$vo['funding']['already_num']}/{$vo['funding']['total_num']}人 <br/>
                        筹单状态：{$vo['funding']['state']}<br/>
                        订单状态：{$vo['state']}<br/>
                    </div>
                </div>
            </div>
        </div>
        <div class="card-footer">
            <!-- <a href="{:U('Funding/detail', ['id'=>$vo['funding']['id']])}" class="button"><span class="icon icon-friends"></span> 筹单</a> -->
            <a href="tel:{$vo['tel']}" class="button"><span class="icon icon-phone"></span> 联系</a>
            <a href="{:U('Funding/contract', ['id'=>$vo['id']])}" class="button"><span class="fa fa-file-text-o"></span> 合同</a>
            <if condition="$vo['state'] eq '待支付'">
                <a href="{:U('Funding/pay', ['id'=>$vo['id']])}" class="button"><span class="fa fa-cc-paypal"></span> 支付</a>
                <elseif condition="$vo['state'] eq '待成功'" />
<!--                 <a href="{:U('Funding/contract', ['id'=>$vo['id']])}" class="button"><span class="fa fa-cc-paypal"></span> 退款</a> -->
                <elseif condition="$vo['state'] eq '待评价'" />
                <a href="{:U('Funding/comment', ['id'=>$vo['id']])}" class="button"><span class="fa fa-thumbs-o-up"></span> 评价</a>
                <elseif condition="$vo['state'] eq '已完成'" />
                <a href="{:U('Funding/complaint', ['id'=>$vo['id']])}" class="button"><span class="fa fa-thumbs-o-down"></span> 投诉</a>
            </if>
            <if condition="($vo['state'] eq '待成功') || ($vo['state'] eq '待评价')|| $vo['state'] eq '已完成'">
                <a href="javascript:void(0);" data-url="{:U('Funding/refund')}" data-id="{$vo['id']}" class="button" onclick="refund()" id="refund-button"><span class="fa fa-mail-reply"></span> 退款 </a>
            </if>
        </div>
    </div>
</volist>
{$page}
<script type="text/javascript">
function refund(t) {
    var reason=prompt("请输入退款原因","");
    if (reason) {
        //跳转链接
        url = $('#refund-button').attr('data-url');
        id = $('#refund-button').attr('data-id');
        window.location.href=url+'?id='+id+'&reason='+reason;
    } else {
        return false;
    }
}
</script>
<include file="Public/sui_footer" />
